home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 43.zip
/
Sources C- WorkDisk V.adf
/
peck
/
list2A.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-02-15
|
628b
|
40 lines
/* list example 3.1. p.57 Peck */
#include "exec/types.h"
#include "exec/lists.h"
struct MyListItem
{
struct Node n;
int x,y ;
};
main()
{
struct MyListItem mli[9];
struct MyListItem *mynode;
struct List MyListHead;
int i;
NewList(&MyListHead); /* init the list header */
for(i=0;i<9;i++)
{
mli[i].x=i;
mli[i].y=i;
AddTail(&MyListHead, &mli[i]);
printf("Just included item nr %d whose (x,y) is (%d,%d)\n",i,mli[i].x,mli[i].y);
}
while((mynode = RemHead(&MyListHead)) != NULL)
{
printf("Just removed item whose (x,y) data is (%d,%d)\n",mynode->x,mynode->y);
}
} /* ====== end of main ====== */